<%@ page session="false" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad/html" prefix="trh"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

<tr:panelGroupLayout rendered="#{not empty globalMessage}">
	<fieldset><legend>Wiadomość od użytkownika: <h:outputText
		value="#{globalMessage.fromUser}" /></legend>
	<table width="100%">
		<tr>
			<td style="width: 50px;"><h:graphicImage
				url="gfx/warning_icon.png" /></td>
			<td><h:outputText value="#{globalMessage.header}" /></td>
		</tr>
		<tr>
			<td><h:outputText value="#{globalMessage.message}" /></td>
			<td><h:commandButton value="Oznacz jako przeczytaną"
				styleClass="button"
				actionListener="#{salesmanController.clearGlobalMessage}" /></td>
		</tr>
	</table>
	</fieldset>
</tr:panelGroupLayout>

<tr:panelGroupLayout rendered="#{not empty globalMessageRequest}">
	<fieldset><legend>Pisanie wiadomości</legend>
	<table width="100%">
		<tr>
			<td><h:inputText value="#{globalMessageRequest.header}"
				styleClass="input_text" style="width:100%" /></td>
		</tr>
		<tr>
			<td><h:inputTextarea rows="4"
				value="#{globalMessageRequest.message}" styleClass="input_text"
				style="width:100%" /></td>
		</tr>
		<tr>
			<td><tr:commandButton styleClass="button"
				text="Wyslij komunikat"
				action="#{salesmanController.addGlobalMessage}" /></td>
		</tr>
	</table>
	</fieldset>
</tr:panelGroupLayout>